export default {
  bind(el, { value, arg }) {
    let timer = null;
    let delay = arg || 500;
    el.$handle = () => {
      clearTimeout(timer);
      timer = setTimeout(() => {
        value();
      }, delay);
    };
    el.addEventListener('click', el.$handle);
  },
  unbind(el) {
    el.removeEventListener('click', el.$handle);
  }
};
